import java.io.IOException;
import java.net.Socket;
import java.util.Scanner;

/**
 * 实现客户端与服务端交互
 */
public class TCPMsgServer extends TCPEchoServer{
    public TCPMsgServer(int port) throws IOException {
        super(port);
    }

    @Override
    protected String process(String request) {
        //创建服务端输入
        Scanner scanner = new Scanner(System.in);
        System.out.print("->");
        String response = scanner.nextLine();
        return response;
    }

    public static void main(String[] args) throws IOException {
        TCPMsgServer tcpMsgServer = new TCPMsgServer(5555);
        tcpMsgServer.start();
    }
}
